Bentley WaterGEMS CONNECT Edition Help

Derivation of the Gradient Algorithm

Given a network defined by N unknown head nodes, P links of unknown flow, and B boundary or fixed head nodes, the network topology can be expressed in two incidence matrices:

A 12 = A 21 T

(P x N) Unknown head nodes incidence matrix

and

A 10 = A 01 T

(P x B) Fixed head nodes incidence matrix

The following convention is used to assign matrix values:

A 12 (i,j) = 1, 0, or -1

(PxN) Unknown head nodes incidence matrix

Assigned nodal demands are given by:

q T = [q 1 , q 2,... , q N ]

(1 x N) Nodal demand vector

Assigned boundary nodal heads are given by:

H f T = [H f1 , H f2 ,..., H fB ]

(1 x B) Fixed nodal head vector

The headloss or gain transform is expressed in the matrix:

F T (Q) = [f 1 , f 2 ..., f p ]

(1 x P) Non-linear laws expressing headlosses in links

These matrix elements that define known or iterative network state can be used to compute the final steady-state network represented by the matrix quantities for unknown flow and unknown nodal head.

Unknown link flow quantities are defined by:

Q T = [Q 1 ,Q 2 ..., Q p ]

(1 x P) Unknown link flow rate vector

Unknown nodal heads are defined by:

H T = [H 1 , H 2 ..., H N ]

(1 x N) Unknown nodal head vector

These topology and quantity matrices can be formulated into the generalized matrix expression using the laws of energy and mass conservation:

A second diagonal matrix that implements the vectorized head change coefficients is introduced. It is generalized for Hazen-Williams friction losses in this case:

This yields the full expression of the network response in matrix form:

To solve the system of non-linear equations, the Newton-Raphson iterative scheme can be obtained by differentiating both side of the equation with respect to Q and H and get:

with

The final recursive form of the Newton-Raphson algorithm can now be derived after matrix inversion and various algebraic manipulations and substitutions (not presented here). The working system of equations for each solution iteration, k, is given by:

The solution for each unknown nodal head for each time iteration is computationally intensive This high-speed solution utilizes a highly optimized sparse matrix solver that is specifically tailored to the structure of this matrix system of equations.

Sources:

Todini, E. and S. Pilati, "A gradient Algorithm for the Analysis of Pipe Networks," Computer Applications in Water Supply, Vol. 1-Systems Analysis and Simulation, ed. By Bryan Callback and Chin-Hour Or, Research Studies Press LTD, Watchword, Hertfordshire, England.